﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.ComponentModel.Design;
using System.Data;
using System.Data.SqlClient;


public partial class DataCenter : System.Web.UI.Page
{
    public string cptype;
    public string qishu;
    protected DataTable Datascq = null;
    protected DataTable Datadlt = null;
    protected DataTable Datafc = null;
    protected DataTable Dataps = null;
    protected DataTable Datapw = null;
    protected DataTable Dataqx = null;
    protected DataTable Dataql = null;
    protected string css = string.Empty;

    protected void Page_Load(object sender, EventArgs e)
    {
        qishu = Request["f"];
        cptype = Request["t"];
        DataCenterscq();
        DataCenterdlt();
        DataCenterfc();
        DataCenterps();
        DataCenterpw();
        DataCenterql();
        DataCenterqx();
    }
    private void DataCenterscq()//双色球
    {

        string sqlstr = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=1   and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=1 and IsWin=1 )a  order by WinMoney desc";

        Datascq = BLL.LotteryChippedUser.GetPageListBysql(sqlstr);

    }


    private void DataCenterdlt()//大乐透
    {

        string sql = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=2  and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=2  and IsWin=1 )a  order by WinMoney desc";

        Datadlt = BLL.LotteryChippedUser.GetPageListBysql(sql);

    }

    private void DataCenterfc()//福彩3D
    {

        string sqls = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=5   and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=5  and IsWin=1 )a  order by WinMoney desc";

        Datafc = BLL.LotteryChippedUser.GetPageListBysql(sqls);

    }

    private void DataCenterps()//排三
    {

        string sqll = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=3   and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=3  and IsWin=1 )a  order by WinMoney desc";
        Dataps = BLL.LotteryChippedUser.GetPageListBysql(sqll);

    }

    private void DataCenterpw()//排五
    {

        string sqlpw = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=4   and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=4   and IsWin=1 )a  order by WinMoney desc";


        Datapw = BLL.LotteryChippedUser.GetPageListBysql(sqlpw);

    }

    private void DataCenterql()//七乐彩
    {

        string sqlql = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=7  and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=7   and IsWin=1)a  order by WinMoney desc";

        Dataql = BLL.LotteryChippedUser.GetPageListBysql(sqlql);

    }

    private void DataCenterqx()//七星彩
    {

        string sqlqx = @"select top(10) * from (select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryChipped].LotteryOpenTime,
                          [LotteryChipped].WinMoney,[LotteryChipped].MySub 
                          from
                          [LotteryChipped], LotteryAnnouncement,CMember
                          where
                          [LotteryChipped].LotteryOpenTime= [LotteryAnnouncement].LotteryQS  and  
                          LotteryChipped.UserID=CMember.Id
                          and [LotteryChipped].LotteryType=6  and IsWin=1

                           union all
			
                         select  CMember.nickname,LotteryAnnouncement.openTime ,[LotteryBuyDetail].[LotteryQS],[dbo].[LotteryBuyDetail].WinMoney,
                         [LotteryBuyDetail].LotteryMoney  
                         from [LotteryBuyDetail],LotteryAnnouncement,CMember  where  
                         [LotteryBuyDetail].LotteryQs=[dbo].[LotteryAnnouncement].LotteryQS   and 
                         [LotteryBuyDetail].User_id=CMember.Id  and [LotteryBuyDetail].LotteryType=6   and IsWin=1)a  order by WinMoney desc";
        Dataqx = BLL.LotteryChippedUser.GetPageListBysql(sqlqx);

    }


}